package com.bjsxt.shop.serviceApi.pojo;

import java.text.ParseException;
import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.bjsxt.shop.common.util.DateFormatUtil;

public class AAdmins
{
	private Integer id;
	private Integer ssoId;
	private String email;
	private String trueName;
	private Byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;
	
	private String token;
	
	
	public Integer getId()
	{
		return id;
	}


	public void setId(Integer id)
	{
		this.id = id;
	}


	public Integer getSsoId()
	{
		return ssoId;
	}


	public void setSsoId(Integer ssoId)
	{
		this.ssoId = ssoId;
	}


	public String getEmail()
	{
		return email;
	}


	public void setEmail(String email)
	{
		this.email = email;
	}


	public String getTrueName()
	{
		return trueName;
	}


	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}


	public Byte getStatus()
	{
		return status;
	}


	public void setStatus(Byte status)
	{
		this.status = status;
	}


	public Date getCreateTime()
	{
		return createTime;
	}


	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}


	public Date getUpdateTime()
	{
		return updateTime;
	}


	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}


	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}


	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}


	@Override
	public String toString()
	{
		return "AAdmins [id=" + id + ", ssoId=" + ssoId + ", email=" + email + ", trueName=" + trueName + ", status="
				+ status + ", createTime=" + createTime + ", updateTime=" + updateTime + ", lastLoginTime="
				+ lastLoginTime + "]";
	}


	public String getToken()
	{
		return token;
	}


	public void setToken(String token)
	{
		this.token = token;
	}


	public AAdmins parseObject(JSONObject adminsJSON)
	{
		DateFormatUtil dateFormatUtil = new DateFormatUtil();
		this.setEmail(adminsJSON.getString("email"));
		this.setSsoId(Integer.valueOf(adminsJSON.getString("id")));
		this.setToken(adminsJSON.getString("token"));
		this.setTrueName(adminsJSON.getString("trueName"));
		this.setStatus(Byte.valueOf("1"));
		try
		{
			this.setUpdateTime(dateFormatUtil.toTimeDate(adminsJSON.getString("updateTime")));
			this.setLastLoginTime(dateFormatUtil.toTimeDate(adminsJSON.getString("lastLoginTime")));
		} catch (ParseException e)
		{
			e.printStackTrace();
		}
		
		return this;
	}
	
	
}
